/**
 *  @file: MainTask.h
 *  @author: nwz
 *  @brief: 
 *  @date: 2024��7��25��
 * 
 */

#pragma once

#include "basic_header.h"

namespace task {

/*
 *
 */
class MainTask {
private:
	static void run(MainTask *task);
	int init();
	void run_();

	void updateInputTime();
	void processKey();
	void processPageChanged();
	uint32_t latest_input_time = 0;

	enum class Event : uint8_t {
		UPDATE_INPUT_TIME, KEY, UI_PAGE_CHANGE,
	};

	QueueHandle_t queue;
	void pub(Event evt);
public:
	MainTask();
	virtual ~MainTask();

	static void start();
	static void notifyUserInputTime();
	static void nofityKeyEvent();
	static void notifyUiPageChange();
};

} /* namespace bsp */
